home *** CD-ROM | disk | FTP | other *** search
-
- [...]
-
- > Now, EasyLife's structures seems to be a promising alternative to the above.
- > But! There's a few things I believe would be limiting factors to both speed
- > and functionality. I'd appriciate some comments on these.
- >
- > 1. Structures will have to be accessed through Amos' string/variable system
- > which will slow down adding/reading big quantaties of data.
- >
- The delay on everything except strings would be neglibigle - after all,
- copying an
- integer so only a move instruction or two. If you have the capability to load
- your
- strings at a particular memory address, you can use St Get (As opposed to St
- Get$)
- to obtain the address of the string, which for example could be passed as the
- buffer
- address of a DOS library Read() call to load directly into a buffer.
-
- > 2. String searching and sorting will be much slower than it would be if I
- > used banks.
-
- Not necessarily. Depends on how you organised the banks. With structures it is
- particularly easy to build trees which can be very quickly searched ( Order
- log n)
- if the elements are inserted in order. And for sorting, you won't have to copy
- the
- strings around - just change the pointers. You may get some help from a
- computer
- science text book on abstract data types, most of which go into great detail
- about
- the different types of data structures you can build with pointers, and the
- efficiency
- of reading / changing each. They will also give you some good sorting
- algorithmns.
-
- A good example of where structured variables are faster is the easylife
- variable checker,
- which runs 2-3 times faster now I have changed it to store the internal lists
- of variable
- names in structures. I am also currently adapting an asteroids game I once
- wrote to use
- structures.
-
- The number of instructions executed during the average structure access is not
- very
- high - the only loops occur in finding the correct structure if an element
- name is used
- in more than one, and in processing the indexes of arrays. Other than that it
- is basically
- a fairly short bit of straight line code - The differicult bits were the
- memory allocator,
- and the initial structures compiler program (Later versions used structured
- variables
- themselves).
-
-
- On the MUI front I'd be interested to hear your (and anyone elses) ideas, as I
- don't
- think many people have used that.
-
-
- +-------------------------+------------------------------------+
- | | _____ |
- | PAUL HICKMAN | / \ ON A HOT SUMMER NIGHT |
- | (ph@doc.ic.ac.uk) | / O O \ WOULD YOU OFFER YOUR |
- | DEPARTMENT OF COMPUTING | | _ | THROAT TO THE WOLF |
- | IMPERIAL COLLEGE LONDON | \ / \ / WITH THE RED ROSES ? |
- | | \_____/ |
- +-------------------------+------------------------------------+
- Machines: Amiga 500 WB1.3 - 1mb Memory - External Disk Drive.
- Amiga 1200 WB3.0 - 6mb Memory - 200Mb Hard Disk.
-
-
-